package com.zmc.lostfound.auth.vo;

import com.zmc.lostfound.common.valid.AddGroup;
import com.zmc.lostfound.common.valid.UpdateGroup;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import javax.validation.constraints.Min;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Null;
import java.io.Serializable;

/**
 * @author zmc
 * @description 角色信息新增/修改请求体
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
@ApiModel("角色信息新增/修改请求体")
public class RoleSaveVO implements Serializable {

    private static final long serialVersionUID = 3039645087914143139L;

    /**
     * 角色id
     */
    @ApiModelProperty("角色id")
    @Null(message = "新增角色信息: 角色id必须为空", groups = {AddGroup.class})
    @NotNull(message = "修改角色信息: 角色id不能为空", groups = {UpdateGroup.class})
    @Min(value = 1, message = "修改角色信息: 角色id必须大于等于1", groups = {UpdateGroup.class})
    private Long id;

    /**
     * 角色名
     */
    @NotBlank(message = "新增角色信息: 角色名不能为空", groups = {AddGroup.class})
    @ApiModelProperty("角色名")
    private String roleName;

    /**
     * 角色码
     */
    @NotBlank(message = "新增角色信息: 角色码不能为空", groups = {AddGroup.class})
    @ApiModelProperty("角色码")
    private String roleCode;

    /**
     * 描述
     */
    @ApiModelProperty("描述")
    private String description;

}
